package com.roc.steelend.controller;


import com.roc.steelend.controller.vo.returnformat.ReturnMsgForTable;
import com.roc.steelend.pojo.BigAccount;
import com.roc.steelend.service.BigAccountService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@Api(tags = "账务大类功能接口")
@CrossOrigin
public class BigAccountController {

    @Autowired
    private BigAccountService bigAccountService;


    @GetMapping("/v1/bigaccount/find")
    @ApiOperation(value = "用于展示账务大类界面的接口")
    public ReturnMsgForTable findBigAccountData(@RequestParam(value = "now",required = true)Integer now,
                                                 @RequestParam(value = "size",required = true)Integer size,
                                                 @RequestParam(value = "isPayTakeId",required = false)Integer isPayTakeId){


       return bigAccountService.findBigAccoutData(now, size,isPayTakeId);
    }


    @GetMapping("/v1/bigaccount/special")
    @ApiOperation(value = "用于展示账务小类的大类选择器接口")
    public List<BigAccount> findBigAccountDataSpecial(
                                                 @RequestParam(value = "isPayTakeId",required = false)Integer isPayTakeId){

        return  bigAccountService.findBigAccoutData2(isPayTakeId);
    }
}
